﻿-- Define the relationship between SecurityRole and Model
ALTER TABLE [dbo].[SecurityRole] WITH CHECK ADD  
       CONSTRAINT [FK_SecurityRole_Model] FOREIGN KEY([Model])
REFERENCES [dbo].[Model] ([ModelId])
ON DELETE NO ACTION
GO
-- Define the relationship between SecurityRole and Person
ALTER TABLE [dbo].[SecurityRole] WITH CHECK ADD  
       CONSTRAINT [FK_SecurityRole_CreatedByPerson] FOREIGN KEY([CreatedBy])
REFERENCES [dbo].[Person] ([PersonId])
ON DELETE NO ACTION
GO
-- Define the relationship between SecurityRole and Person
ALTER TABLE [dbo].[SecurityRole] WITH CHECK ADD  
       CONSTRAINT [FK_SecurityRole_LastChangedBy] FOREIGN KEY([LastChangedBy])
REFERENCES [dbo].[Person] ([PersonId])
ON DELETE NO ACTION
GO